import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [{
  path: '/login',
  component: () => import('@/views/login/index'),
  hidden: true
},

{
  path: '/404',
  component: () => import('@/views/404'),
  hidden: true
},

{
  path: '/',
  component: Layout,
  redirect: '/dashboard',
  children: [{
    path: 'dashboard',
    name: 'Dashboard',
    component: () => import('@/views/dashboard/index'),
    meta: {
      title: '首页',
      icon: 'dashboard'
    }
  }]
},
{
  path: '*',
  redirect: '/404',
  hidden: true
},
{
  path: '/system',
  component: Layout,
  redirect: '/system/dtt',
  alwaysShow: true, //总是显示根菜单
  name: 'System',
  meta: {
    title: '字典管理',
    icon: 'nested'
  },
  children: [{
    path: 'dtt',
    component: () => import('@/views/system_base/dictionaryTableType'),
    name: 'dtt',
    meta: {
      title: '字典类别管理'
    }
  },
  {
    path: 'dt',
    component: () => import('@/views/system_base/dictionaryTableType'),
    name: 'dt',
    meta: {
      title: '字典管理'
    }
  },
  ]
},
{
  path: '/systems',
  component: Layout,
  redirect: '/systems/dtt',
  alwaysShow: true, //总是显示根菜单
  name: 'Systems',
  meta: {
    title: '人事管理',
    icon: 'nested'
  },
  children: [{
    path: 'renshi',
    component: () => import('@/views/system_base/Employee/personnel_kanban'),
    name: 'renshi',
    meta: {
      title: '人事看板'
    }
  },
  {
    path: '/dtt',
    component: () => import('@/views/system_base/Employee/Employee_registration'),
    name: 'dtt',
    meta: {
      title: '🍁员工登记',
    },
  },
  {
    path: 'dttt',
    component: () => import('@/views/system_base/Employee/Employee_regAdd'),
    name: 'dttt',
    meta: {
      title: '新增员工'
    }
  },
  {
    path: '/ruzhi',
    component: () => import('@/views/system_base/Employee/Hired_handle'),
    name: 'ruzhi',
    meta: {
      title: '🍁入职办理',
    },
  },
  {
    path: '/ruzhia',
    component: () => import('@/views/system_base/Employee/Hired_handleadd'),
    name: 'ruzhia',
    meta: {
      title: '新增入职'
    }
  },
  {
    path: '/ruzhil',
    component: () => import('@/views/system_base/Employee/Hired_handlelook'),
    name: 'ruzhil',
    meta: {
      title: '查看入职'
    }
  },
  {
    path: '/lizhi',
    component: () => import('@/views/system_base/Employee/Leave_handle'),
    name: 'lizhi',
    meta: {
      title: '🍁离职办理',
    },

    children: [{
        path: 'cheliang',
        component: () => import('@/views/system_base/Jichuxinxi/Cheliang'),
        name: 'cheliang',
        meta: {
          title: '车辆管理'
        }
      },
      {
        path: 'huozhu',
        component: () => import('@/views/system_base/Jichuxinxi/Huozhu'),
        name: 'huozhu',
        meta: {
          title: '货主管理'
        }
      },
      {
        path: 'waixie',
        component: () => import('@/views/system_base/Jichuxinxi/Waixie'),
        name: 'waixie',
        meta: {
          title: '外协单位管理'
        }
      },
      {
        path: 'youfei',
        component: () => import('@/views/system_base/Jichuxinxi/Youfei'),
        name: 'youfei',
        meta: {
          title: '油费管理'
        }
      },
      {
        path: 'xianlu',
        component: () => import('@/views/system_base/Jichuxinxi/Xianlu'),
        name: 'xianlu',
        meta: {
          title: '路线管理'
        }
      },
      {
        path: '/chebianji/:id',
        component: () => import('@/views/system_base/Jichuxinxi/chebianji'),
        name: 'chebianji',

      },
      {
        path: 'ditu',
        component: () => import('@/views/system_base/Jichuxinxi/ditu'),
        name: 'ditu',
        meta: {
          title: '地图'
        }
      },
      

    ]
  },
  {
    path: '/jiesuan',
    component: Layout,
    redirect: '/jiesuan/jie',
    alwaysShow: true, //总是显示根菜单
    name: 'jie',
    meta: {
      title: '结算管理',
      icon: 'nested'
    }
  },
  {
    path: '/lizhia',
    component: () => import('@/views/system_base/Employee/Leave_handleadd'),
    name: 'lizhia',
    meta: {
      title: '新增离职'
    }
  },
  {
    path: '/lizhil',
    component: () => import('@/views/system_base/Employee/Leave_handlelook'),
    name: 'lizhil',
    meta: {
      title: '查看离职'
    }
  },
  {
    path: '/zhuanz',
    component: () => import('@/views/system_base/Employee/Positive_deal'),
    name: 'zhuanz',
    meta: {
      title: '🍁转正办理',

    },
  },
  {
    path: '/zhuanza',
    component: () => import('@/views/system_base/Employee/Positive_dealadd'),
    name: 'zhuanza',
    meta: {
      title: '新增转正'
    }
  },
  {
    path: '/zhuanzl',
    component: () => import('@/views/system_base/Employee/Positive_deallook'),
    name: 'zhuanzl',
    meta: {
      title: '查看转正'
    }
  },
  ]
},
{
  path: '/systemmanagement',
  component: Layout,
  redirect: '/systement/system',
  alwaysShow: true, //总是显示根菜单
  name: 'systemmanagement',
  meta: {
    title: '系统管理',
    icon: 'nested'
  },
  children: [{
    path: 'ZhiWei',
    component: () => import('@/views/system_base/SystemManagement/Positionmanagement'),
    name: 'ZhiWei',
    meta: {
      title: '职位管理'
    }
  },
  {
    path: 'BuMen',
    component: () => import('@/views/system_base/SystemManagement/Departmentmanagement'),
    name: 'BuMen',
    meta: {
      title: '部门管理'
    }
  },
  {
    path: 'Role',
    component: () => import('@/views/system_base/SystemManagement/RuleManagement'),
    name: 'Role',
    meta: {
      title: '角色管理'
    }
  },

  {
    path: 'CaoZuoYuan',
    component: () => import('@/views/system_base/SystemManagement/OperatorManagement'),
    name: 'CaoZuoYuan',
    meta: {
      title: '操作员管理'
    }
  },
  {
    path: 'JiChuXinXi',
    component: () => import('@/views/system_base/SystemManagement/BasicsMessage'),
    name: 'JiChuXinXi',
    meta: {
      title: '基础信息'
    }
  },
  ]
},
{
  path: '/cheliang',
  component: Layout,
  redirect: '/cheliang/che',
  alwaysShow: true, //总是显示根菜单
  name: 'che',
  meta: {
    title: '基础管理',
    icon: 'nested'
  },
  children: [{
    path: 'cheliang',
    component: () => import('@/views/system_base/Jichuxinxi/Cheliang'),
    name: 'cheliang',
    meta: {
      title: '车辆管理'
    }
  },
  {
    path: 'huozhu',
    component: () => import('@/views/system_base/Jichuxinxi/Huozhu'),
    name: 'huozhu',
    meta: {
      title: '货主管理'
    }
  },
  {
    path: 'waixie',
    component: () => import('@/views/system_base/Jichuxinxi/Waixie'),
    name: 'waixie',
    meta: {
      title: '外协单位管理'
    }
  },
  {
    path: 'youfei',
    component: () => import('@/views/system_base/Jichuxinxi/Youfei'),
    name: 'youfei',
    meta: {
      title: '油费管理'
    }
  },
  {
    path: 'xianlu',
    component: () => import('@/views/system_base/Jichuxinxi/Xianlu'),
    name: 'xianlu',
    meta: {
      title: '路线管理'
    }
  },
  {
    path: '/chebianji/:id',
    component: () => import('@/views/system_base/Jichuxinxi/chebianji'),
    name: 'chebianji',

  },

  ]
},
{

  path: '/jiesuan',
  component: Layout,
  redirect: '/jiesuan/jie',
  alwaysShow: true, //总是显示根菜单
  name: 'jie',
  meta: {
    title: '结算管理',
    icon: 'nested'
  },
  children: [{
    path: 'yingshou',
    component: () => import('@/views/system_base/Jiesuanguanli/yingshou'),
    name: 'yingshou',
    meta: {
      title: '应收费用管理'
    }
  },
  {
    path: 'yingfu',
    component: () => import('@/views/system_base/Jiesuanguanli/yingfu'),
    name: 'yingfu',
    meta: {
      title: '应付费用管理'
    }
  },
  {
    path: 'jinxiang',
    component: () => import('@/views/system_base/Jiesuanguanli/jinxiang'),
    name: 'jinxiang',
    meta: {
      title: '进项发票管理'
    }
  },
  {
    path: 'xiaoxiang',
    component: () => import('@/views/system_base/Jiesuanguanli/xiaoxiang'),
    name: 'xiaoxiang',
    meta: {
      title: '销项发票管理'
    }
  },
  {
    path: 'fukuan',
    component: () => import('@/views/system_base/Jiesuanguanli/fukuan'),
    name: 'fukuan',
    meta: {
      title: '付款管理'
    }
  }

    // {
    //   path: 'dt',
    //   component: () => import('@/views/system_base/dictionaryTableType'),
    //   name: 'dt',
    //   meta: {
    //     title: '字典管理'
    //   }
    // },
  ]
}


  ,
{

  path: '/Contractmanagement',
  component: Layout,
  redirect: '/systement/Contractmanagement',
  alwaysShow: true, //总是显示根菜单
  name: 'Contractmanagement',
  meta: {
    title: '合同管理',
    icon: 'nested'
  },
  children: [{
    path: 'huozhu',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'huozhu ',
    meta: {
      title: '货主合同管理'
    }
  },
  {
    path: 'chengyun',
    component: () => import('@/views/system_base/Contract_Management/AcceptContractManagement'),
    name: 'chengyun',
    meta: {
      title: '承运合同管理'
    }
  },
  {


    path: '/Contractmanagement',
    component: Layout,
    redirect: '/systement/Contractmanagement',
    alwaysShow: true, //总是显示根菜单
    name: 'Contractmanagement',

    path: 'tongyong',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'tongyong',

    meta: {
      title: '通用合同管理'
    }
  },

 
  ]
},

{

  path: '/Approvaltmanagement',
  component: Layout,
  redirect: '/systement/Approvaltmanagement',
  alwaysShow: true, //总是显示根菜单
  name: 'Approvaltmanagement',
  meta: {
    title: '审批管理',
    icon: 'nested'
  },
  children: [{
    path: 'huozhushen',
    component: () => import('@/views/system_base/ApprovalManagerment/OwnerrApprovalManagement'),
    name: 'huozhushen ',
    meta: {
      title: '货主合同审批'
    }
  },
  {
    path: 'chengyunshen',
    component: () => import('@/views/system_base/ApprovalManagerment/AcceptApprovalManagement'),
    name: 'chengyun',
    meta: {
      title: '承运合同审批'
    }
  },
  {
    path: 'tongyongshen',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'tongyongshen',
    meta: {
      title: '通用合同审批'
    }
  },

  {
    path: 'wuzilinyongshen',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'wuzilinyongshen',
    meta: {
      title: '物资采领用审批'
    }
  },
  {
    path: 'fukuanshen',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'fukuanshen',
    meta: {
      title: '付款审批'
    }
  },
  {
    path: 'ruzhishen',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'ruzhishen',
    meta: {
      title: '入职审批'
    }
  },
  {
    path: 'lizhishen',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'lizhishen',
    meta: {
      title: '离职审批'
    }
  },
  {
    path: 'zhuanzhengshen',
    component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
    name: 'zhuanzhengshen',
    meta: {
      title: '转正审批'
    }
  },
  ]
},



{

  path: '/Weihu',
  component: Layout,
  redirect: '/systement/Weihu',
  alwaysShow: true, //总是显示根菜单
  name: 'Weihu',
  meta: {
    title: '维护',
    icon: 'nested'
  },
  children: [{
    path: 'Weixiu',
    component: () => import('@/views/system_base/Weihu/Weixiu'),
    name: 'Weixiu',
    meta: {
      title: '维修记录'
    }
  },
  {
    path: 'Baoyang',
    component: () => import('@/views/system_base/Weihu/Baoyang'),
    name: 'Baoyang',
    meta: {
      title: '保养记录'
    }
  },
  {
    path: 'Weizhang',
    component: () => import('@/views/system_base/Weihu/Weizhang'),
    name: 'Weizhang',
    meta: {
      title: '违章记录'
    }
  },

  {
    path: 'Shigu',
    component: () => import('@/views/system_base/Weihu/Shigu'),
    name: 'Shigu',
    meta: {
      title: '事故记录'
    }
  },
  {
    path: 'Luntai',
    component: () => import('@/views/system_base/Weihu/Luntai'),
    name: 'Luntai',
    meta: {
      title: '轮胎使用记录'
    }
  },

  {
    path: 'Feiyong',
    component: () => import('@/views/system_base/Weihu/Feiyong'),
    name: 'Feiyong',
    meta: {
      title: '费用记录'
    }
  },
  ]

}

  ,
{

  path: '/mater',
  component: Layout,
  redirect: '/mater/mate',
  alwaysShow: true,
  name: 'mate',
  meta: {
    title: '物资管理',
    icon: 'nested'
  },
  children: [{
    path: 'tongji',
    component: () => import('@/views/system_base/Materials/Material_statistics'),
    name: 'tongji',
    meta: {
      title: '物资统计'
    }
  },
  {
    path: '/caigou',
    component: () => import('@/views/system_base/Materials/materials_purchasing'),
    name: 'caigou',
    meta: {
      title: '🍁物资采购',
    },

    children: [{
        path: 'ZhiWei',
        component: () => import('@/views/system_base/Contract_Management/OwnerContractManagement'),
        name: 'ZhiWei',
        meta: {
          title: '货主合同管理'
        }
      },
      {
        path: 'BuMen',
        component: () => import('@/views/system_base/SystemManagement/Departmentmanagement'),
        name: 'BuMen',
        meta: {
          title: '部门管理'
        }
      },
      {
        path: 'Role',
        component: () => import('@/views/system_base/SystemManagement/RuleManagement'),
        name: 'Role',
        meta: {
          title: '角色管理'
        }
      },

      {
        path: 'CaoZuoYuan',
        component: () => import('@/views/system_base/SystemManagement/OperatorManagement'),
        name: 'CaoZuoYuan',
        meta: {
          title: '操作员管理'
        }
      },
      {
        path: 'JiChuXinXi',
        component: () => import('@/views/system_base/SystemManagement/BasicsMessage'),
        name: 'JiChuXinXi',
        meta: {
          title: '基础信息'
        }
      },
    ]
  },

  {

    path: '/Weihu',
    component: Layout,
    redirect: '/systement/Weihu',
    alwaysShow: true, //总是显示根菜单
    name: 'Weihu',
    meta: {
      title: '维护',
      icon: 'nested'
    },
    children: [{
        path: 'Weixiu',
        component: () => import('@/views/system_base/Weihu/Weixiu'),
        name: 'Weixiu',
        meta: {
          title: '维修记录'
        }
      },
      {
        path: 'Baoyang',
        component: () => import('@/views/system_base/Weihu/Baoyang'),
        name: 'Baoyang',
        meta: {
          title: '保养记录'
        }
      },
      {
        path: 'Weizhang',
        component: () => import('@/views/system_base/Weihu/Weizhang'),
        name: 'Weizhang',
        meta: {
          title: '违章记录'
        }
      },

      {
        path: 'Shigu',
        component: () => import('@/views/system_base/Weihu/Shigu'),
        name: 'Shigu',
        meta: {
          title: '事故记录'
        }
      },
      {
        path: 'Luntai',
        component: () => import('@/views/system_base/Weihu/Luntai'),
        name: 'Luntai',
        meta: {
          title: '轮胎使用记录'
        }
      },

      {
        path: 'Feiyong',
        component: () => import('@/views/system_base/Weihu/Feiyong'),
        name: 'Feiyong',
        meta: {
          title: '费用记录'
        }
      },
    ]
  },
 
{

    path: '/mater',
    component: Layout,
    redirect: '/mater/mate',
    alwaysShow: true,
    name: 'mate',
    meta: {
      title: '物资管理',
      icon: 'nested'
    },
    children: [{
        path: 'tongji',
        component: () => import('@/views/system_base/Materials/Material_statistics'),
        name: 'tongji',
        meta: {
          title: '物资统计'
        }
      },
      {
        path: '/caigou',
        component: () => import('@/views/system_base/Materials/materials_purchasing'),
        name: 'caigou',
        meta: {
          title: '🍁物资采购',
        },
      },
      {
        path: 'caigoua',
        component: () => import('@/views/system_base/Materials/purchasing_requisition'),
        name: 'caigoua',
        meta: {
          title: '采购申请'
        }
      },
      {
        path: '/ruku',
        component: () => import('@/views/system_base/Materials/stock_manager'),
        name: 'ruku',
        meta: {
          title: '🍁入库管理',
        },
      },
      {
        path: 'rukua',
        component: () => import('@/views/system_base/Materials/stock_manageradd'),
        name: 'rukua',
        meta: {
          title: '新增入库'
        }
      },
      {
        path: '/lingyong',
        component: () => import('@/views/system_base/Materials/Aid_recipients'),
        name: 'lingyong',
        meta: {
          title: '🍁物资领用',
        },
      },
      {
        path: 'lingyonga',
        component: () => import('@/views/system_base/Materials/recipient_plan'),
        name: 'lingyonga',
        meta: {
          title: '领用申请'
        }
      },
    ]
  }, 

  
  
  {

    path: '/genzong',
    component: Layout,
    redirect: '/genzong/genzongs',
    alwaysShow: true,
    name: 'genzongs',
    meta: {
      title: '跟踪管理',
      icon: 'nested'
    },
    children: [{
        path: '/htgz',
        component: () => import('@/views/system_base/TailAfter/Ownerscontract'),
        name: 'htgz',
        meta: {
          title: '🍁货主合同跟踪',
        },
      },
      {
        path: 'dylx',
        component: () => import('@/views/system_base/TailAfter/Defineroute'),
        name: 'dylx',
        meta: {
          title: '定义路线'
        }
      },
      {
        path: 'zxgzzc',
        component: () => import('@/views/system_base/TailAfter/Online_trackingY'),
        name: 'zxgzzc',
        meta: {
          title: '在线跟踪-正常'
        }
      },
      {
        path: 'zxgzyc',
        component: () => import('@/views/system_base/TailAfter/Online_trackingN'),
        name: 'zxgzyc',
        meta: {
          title: '在线跟踪-异常'
        }
      },
      {
        path: 'gzjl',
        component: () => import('@/views/system_base/TailAfter/Trackrecord'),
        name: 'gzjl',
        meta: {
          title: '跟踪记录'
        }
      },
      {
        path: '/cyjtgz',
        component: () => import('@/views/system_base/TailAfter/ConTaffreightment'),
        name: 'cyhtgz',
        meta: {
          title: '🍁承运合同跟踪',
        },
      },
      
    ]

  
  },


    ]
  },
  {
    path: 'caigoua',
    component: () => import('@/views/system_base/Materials/purchasing_requisition'),
    name: 'caigoua',
    meta: {
      title: '采购申请'
    }
  },
  {
    path: '/ruku',
    component: () => import('@/views/system_base/Materials/stock_manager'),
    name: 'ruku',
    meta: {
      title: '🍁入库管理',
    },
  },
  {
    path: 'rukua',
    component: () => import('@/views/system_base/Materials/stock_manageradd'),
    name: 'rukua',
    meta: {
      title: '新增入库'
    }
  },
  {
    path: '/lingyong',
    component: () => import('@/views/system_base/Materials/Aid_recipients'),
    name: 'lingyong',
    meta: {
      title: '🍁物资领用',
    },
  },
  {
    path: 'lingyonga',
    component: () => import('@/views/system_base/Materials/recipient_plan'),
    name: 'lingyonga',
    meta: {
      title: '领用申请'
    }
  },


 
{


  path: '/genzong',
  component: Layout,
  redirect: '/genzong/genzongs',
  alwaysShow: true,
  name: 'genzongs',
  meta: {
    title: '跟踪管理',
    icon: 'nested'
  },
  children: [{
    path: '/htgz',
    component: () => import('@/views/system_base/TailAfter/Ownerscontract'),
    name: 'htgz',
    meta: {
      title: '🍁货主合同跟踪',
    },
  },
  {
    path: 'dylx',
    component: () => import('@/views/system_base/TailAfter/Defineroute'),
    name: 'dylx',
    meta: {
      title: '定义路线'
    }
  },
  {
    path: 'zxgzzc',
    component: () => import('@/views/system_base/TailAfter/Online_trackingY'),
    name: 'zxgzzc',
    meta: {
      title: '在线跟踪-正常'
    }
  },
  {
    path: 'zxgzyc',
    component: () => import('@/views/system_base/TailAfter/Online_trackingN'),
    name: 'zxgzyc',
    meta: {
      title: '在线跟踪-异常'
    }
  },
  {
    path: 'gzjl',
    component: () => import('@/views/system_base/TailAfter/Trackrecord'),
    name: 'gzjl',
    meta: {
      title: '跟踪记录'
    }
  },
  {
    path: '/cyjtgz',
    component: () => import('@/views/system_base/TailAfter/ConTaffreightment'),
    name: 'cyhtgz',
    meta: {
      title: '🍁承运合同跟踪',
    },
  },
  ]
}

]





const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
